<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/global.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <%@ include file="/commons/basejs.jsp" %>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>机构科室管理</title>
</head>
<body>
    <script   type="text/javascript" src="../../../static/easyui/plugins/datagrid.show.js"></script>
    <script   type="text/javascript" src="../../../static/js/sellerDept.js"></script>
    <div class="easyui-layout" fit="true" >
        <!--west基础科室start-->
        <div data-options="region:'west',split:true,border:false" title="基础科室列表" style="width:300px;">
            <table id="deparment_datagrid" class="easyui-datagrid"
                   data-options="
		   		url:'${path}/sellerDept/baseDeptdg.do',
		   		fit:true,
		   		fitColumns: true,
		   		rownumbers:true,
		   		toolbar:'#deparment_tools',
		   		singleSelect:true">
                <thead>
                <th data-options="field:'id'">ID</th>
                <th data-options="field:'name',width:220">科室名称</th>
                <th data-options="field:'logo',width:80,formatter:formatterImg">logo</th>
                <th data-options="field:'ord',width:50">排序</th>
                </thead>
            </table>
            <div id="deparment_tools">
                <shiro:hasPermission name="/sellerDept/add.do">
                    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="openEditBox('add')">添加</a>
                </shiro:hasPermission>
                <shiro:hasPermission name="/sellerDept/edit.do">
                    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="openEditBox('edit')">编辑</a>
                </shiro:hasPermission>
                <shiro:hasPermission name="/sellerDept/del.do">
                    <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="deleteBase()">删除</a>
                </shiro:hasPermission>
                <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload'" onclick="$('#deparment_datagrid').datagrid('reload')">刷新</a>
            </div>
        </div>

        <!--center重点科室 start-->
        <div data-options="region:'center',split:true,border:false" title="机构科室" style="overflow: hidden">
            <table id="sellerDept_datagrid" class="easyui-datagrid"
                   data-options="
		   		url:'${path}/sellerDept/sellerDeptdg.do',
		   		fit:true,
		   		rownumbers:true,
		   		fitColumns: true,
		   		toolbar:'#sellerDept_tools',
		   		pagination:true,
		   		singleSelect:true">
                <thead>
                <th data-options="field:'id'">ID</th>
                <th data-options="field:'hospitalDepartmentId'" hidden>科室ID</th>
                <th data-options="field:'sellerId'" hidden>机构ID</th>
                <th data-options="field:'name',width:200">科室名称</th>
                <th data-options="field:'sellerName',width:200">机构名称</th>
                <th data-options="field:'intro',width:400">简介</th>
                <th data-options="field:'achievement',width:400">荣誉</th>
                <th data-options="field:'ord',width:50">排序</th>
                <th data-options="field:'updateTime',width:200,formatter:formatDateBoxFull" >修改时间</th>
                </thead>
            </table>
            <div id="sellerDept_tools">
                <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'" onclick="openShopDeptBox('add')">添加</a>
                <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit'" onclick="openShopDeptBox('edit')">修改</a>
                <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-del'" onclick="delShopDept()">删除</a>
                <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload'" onclick="refcardSellerdept()">重置</a>
            </div>
        </div>

        <!--center机构列表 start-->
        <div data-options="region:'east',split:true,border:false" title="机构科室" style="width: 250px;">
            <table id="seller_datagrid" class="easyui-datagrid"
                   data-options="
		   		url:'${path}/sellerDept/sellerdg.do',
		   		fit:true,
		   		rownumbers:true,
		   		fitColumns: true,
		   		toolbar:'#seller_tools',
		   		pagination:true,
		   		singleSelect:true,
            onClickRow:function(index, row){
		   			changeShoprow(row.id);
		   		}">
                <thead>
                <th data-options="field:'id'">ID</th>
                <th data-options="field:'name'" width="125">机构名称</th>
                <th data-options="field:'twoAreaName'" hidden>所在地</th>
                </thead>
            </table>
            <div id="seller_tools">
                <input id="searchSeller" class="easyui-searchbox" data-options="prompt:'请输入机构名',searcher:searchSeller" style="width:180px;"/>
                <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload'" onclick="refcardEmployee()">重置</a>
            </div>
        </div>
        
    </div>
    <!--编辑基础科室弹层-->
    <div class="easyui-dialog" id="editBase_dialog" title="添加基础科室" data-options="closed:true,modal:true,width:400,height:192">
        <form id="editbaseForm" method="post" >
            <input name="id" value="" hidden>
            <table class="grid" align="center" style="width: 370px;height: 100px;margin-top: 10px">
                <tr>
                    <td width="80px">科室名称：</td>
                    <td width="190px"><input name="name" class="easyui-validatebox" data-options="required:true"/></td>
                    <td rowspan="2" width="115px"><img id="baselogo" src=""></td>
                </tr>
                <tr>
                    <td width="80px">排序：</td>
                    <td width="190px"><input name="ord" class="easyui-validatebox" data-options="required:true,number:true"/></td>
                </tr>
                <tr>
                    <td width="80px"><lable for="logo">图标:</lable></td>
                    <td width="190px"><div id="upload_ue"></div><input class="easyui-validatebox" readonly="readonly" type="text" id="img"   data-options="required:true"  name="logo"/></td>
                    <td width="115px"><a href="javascript:void(0);"  class="easyui-linkbutton" data-options="iconCls:'icon-edit'" onclick="upImage();">上传图标</a></td>
                </tr>
            </table>
            <div style="margin-top: 10px;text-align: center">
                <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save'" onclick="editDept()">保存</a>
                <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="$('#editBase_dialog').dialog('close')">取消</a>
            </div>
        </form>
    </div>
    <!--编辑机构科室弹层-->
    <div class="easyui-dialog" id="editDept_dialog" title="添加科室" data-options="closed:true,modal:true,width:500,height:440">
        <form id="editDeptForm" method="post" >
            <input name="id" value="" hidden>
            <input name="sellerId" value="" hidden>
            <table class="grid" align="center" style="width: 450px;height: 100px;margin-top: 10px">
                <tr>
                    <th colspan="4"><span class="shopName"></span></th>
                </tr>
                <tr>
                    <td width="80px">科室名称：</td>
                    <td width="190px">
                        <select id="selcardcat1" class="easyui-validatebox easyui-combobox" style="width: 150px;" data-options="panelHeight:'auto',required:true" name="hospitalDepartmentId"  /></select>
                    </td>
                    <td width="80px">排序：</td>
                    <td><input name="ord" style="width: 60px" class="easyui-validatebox" data-options="required:true,number:true"/></td>
                </tr>
                <tr>
                    <td width="80px">荣誉：</td>
                    <td colspan="3"><textarea name="achievement" style="width: 340px;height: 100px;"></textarea></td>
                </tr>
                <tr>
                   <td width="80px">简介：</td>
                    <td colspan="3"><textarea name="intro"  style="width: 340px;height:150px;"></textarea></td>
                </tr>
            </table>
            <div style="margin-top: 10px;text-align: center">
                <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save'" onclick="editShopDept()">保存</a>
                <a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" onclick="$('#editBase_dialog').dialog('close')">取消</a>
            </div>
        </form>
    </div>
</body>
</html>
